/**
Company: Sarkar software technologys
WebSite: http://www.sarkar.cn
Author: yeganaaa
Date : 6/1/18
Time: 3:33 PM
 */

package Cn.Sarkar.EntityDream.CoreEngine.RDBMS.MySql

import java.sql.Connection

fun createDataBaseIfNotExists(homeConnection: Connection, databaseName: String){
    val statement = homeConnection.createStatement()
    val result = statement.executeUpdate("CREATE DATABASE IF NOT EXISTS $databaseName")
    statement.close()
}

fun MySqlDataContext.createDataBaseIfNotExists(databaseName: String) = createDataBaseIfNotExists(this.connection, databaseName)